package nowCoder;

import org.w3c.dom.Node;

import java.util.Scanner;

public class HJ51 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            Node first = new Node(in.nextInt(), null);
            Node h = first;
            for (int i = 1; i < n; i++) {
                h.next = new Node(in.nextInt(), null);
                h = h.next;
            }
            int k = in.nextInt();
            int size = 0;
            h = first;
            while (h.next != null) {
                size++;
                h = h.next;
            }
            if (k == size) {
                System.out.println(first.k);
            } else if (k == 1) {
                System.out.println(h.k);
            } else {
                h = first;
                for (int i = 0; i < size - k + 1; i++) {
                    h = h.next;
                }
                System.out.println(h.k);
            }
        }
    }
    static class Node{
        int k;
        Node next;
        public Node(int k, Node next){
            this.k = k;
            this.next = next;
        }
    }
}
